package com.fast.enums;

import com.fast.constants.HttpStatus;
import lombok.Getter;

/**
 * @author ruan cai yuan
 * @version 1.0
 * @fileName com.fast.enums.CodeEnum
 * @description: TODO
 * @since 2024/6/22 0:35
 */
@Getter
public enum CodeEnum {
    SUCCESS(HttpStatus.SUCCESS, "Success"),
    BAD_REQUEST(HttpStatus.BAD_REQUEST, "参数不正确"),
    AuthenticationFailed(HttpStatus.AuthenticationFailed, "认证失败（用户名或密码不正确）"),
    DATABASE_ERROR(HttpStatus.DATABASE_ERROR, "数据库异常"),
    DUPLICATE_KEY_ERROR(20001, "唯一性约束校验失败"),
    BUSINESS_ERROR(HttpStatus.BUSINESS_ERROR, "业务异常"),
    UNAUTHORIZED(HttpStatus.UNAUTHORIZED, "权限不足(请先登录)"),
    FORBIDDEN(HttpStatus.FORBIDDEN, "访问受限(无权访问)"),
    ERROR(HttpStatus.ERROR, "系统异常"),
    REDIS_CONN_ERROR(HttpStatus.ERROR, "redis连接异常"),


    ;
    private final Integer code;
    private final String msg;
    CodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
